package 蓝桥杯.算法板子;

import java.math.BigInteger;

/**
 * @Title: BigInteger
 * @Author 贾金博
 * @Package 蓝桥杯.算法板子
 * @Date 2024/4/12 18:35
 * @description:
 */
class MyBigInteger {
    public static void main(String[] args) {
        //快速幂
        //他的比自己手写的快速幂还要快
        BigInteger bigInteger = new BigInteger("3").modPow(new BigInteger("2"), new BigInteger("4"));
        System.out.println(Integer.valueOf(bigInteger.toString()));

        //gcd
        BigInteger a = new BigInteger("2");
        BigInteger b = new BigInteger("4");
        System.out.println(a.gcd(b));

        //下一个质数
        System.out.println(a.nextProbablePrime());
    }
}


